package edu.sctu.fengleilin.month06.day150607;

/**
 * Created by user09 on 2015/6/7.
 */
public class MyThread implements Runnable {
    private int ticket = 5;  //5张票

    public void run() {
        for (int i=0; i<=20; i++) {
            if (this.ticket > 0) {
                System.out.println(Thread.currentThread().getName()+ "正在卖票"+this.ticket--);
            }
        }
    }
}
